home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_iiperf.asp < prev    next >
Encoding:
Text File  |  1999-06-03  |  9.0 KB  |  316 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8. <!--#include file="iiperf.str"-->
  9. <% 
  10. On Error Resume Next 
  11.  
  12. Dim path, currentobj, mbw, maxtext, logonly
  13.  
  14. path=Session("spath")
  15. Session("path")=path
  16. Session("SpecObj")=""
  17. Session("SpecProps")=""
  18. Set currentobj=GetObject(path)
  19. %>
  20.  
  21. <!--#include file="iiset.inc"-->
  22. <!--#include file="iisetfnt.inc"-->
  23. <%
  24. function writeSlider(prop, stops, width, selnum)
  25.     dim slidestr, i
  26.     slidestr="<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  27.     for i=0 to stops-2
  28.         slidestr=slidestr & drawStop(i,prop, selnum) 
  29.         slidestr=slidestr & "<IMG SRC='images/slidersp.gif' WIDTH=" & width & " HEIGHT=26 BORDER=0>"
  30.     Next
  31.     slidestr=slidestr & drawStop(i, prop, selnum)
  32.     slidestr=slidestr & "<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  33.     writeSlider=slidestr
  34. end function 
  35.  
  36. function drawStop(curr,prop, selnum)
  37.     dim thisname, slidestr,formname
  38.     thisname=quote & prop & curr & quote 
  39.     if Session("IsIE") then 
  40.         formname = "parent.document.userform."
  41.     else
  42.         formname = "document.userform."
  43.     end if 
  44.     slidestr="<A HREF='javascript:moveSlider(" &  formname & prop & ", " & quote & prop & quote & "," & curr & ")'>"
  45.     if curr=selnum then
  46.         drawStop=slidestr & "<IMG NAME=" & thisname &  " SRC='images/slideron.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  47.     else
  48.         drawStop=slidestr & "<IMG NAME=" & thisname & " SRC='images/slideroff.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  49.     end if
  50. end function 
  51.  
  52.  %>
  53.  
  54.  
  55.  
  56. <HTML>
  57.  
  58. <HEAD>
  59. <TITLE></TITLE>
  60. <SCRIPT LANGUAGE="JavaScript">
  61.  
  62.     <!--#include file="iijsfuncs.inc"-->
  63.     
  64. <% if Session("vtype") = "svc" then %>    
  65.     top.title.Global.helpFileName="iipy_47";
  66.     top.title.Global.siteProperties = false;
  67.  
  68. <% else %>
  69.     top.title.Global.helpFileName="iipy_30";
  70.     top.title.Global.siteProperties = true;
  71. <% end if %>    
  72.  
  73.  
  74. <% if not Session("IsIE") then %>
  75.     slideron=new Image(11,26);
  76.     slideron.src="images/slideron.gif";    
  77.     slideroff=new Image(11,26);
  78.     slideroff.src="images/slideroff.gif";
  79.     lastslide="ServerSize<%= currentobj.ServerSize %>";
  80. <% end if %>
  81.  
  82.     function SetMaxBW(isChecked){
  83.         if (isChecked){
  84.             if (document.userform.hdnhdnMaxBandwidth.value == "")
  85.             {
  86.                 document.userform.hdnhdnMaxBandwidth.value = 1024;
  87.             }
  88.             document.userform.hdnMaxBandwidth.value=document.userform.hdnhdnMaxBandwidth.value;
  89.             document.userform.MaxBandwidth.value = document.userform.hdnhdnMaxBandwidth.value * 1024;
  90.         }
  91.         else{
  92.             document.userform.hdnhdnMaxBandwidth.value=document.userform.hdnMaxBandwidth.value;
  93.             document.userform.hdnMaxBandwidth.value="";
  94.             document.userform.MaxBandwidth.value = -1;
  95.         }
  96.     }
  97.     
  98.     function calcBW(thiscntrl){
  99.         if (thiscntrl.value == ""){
  100.             document.userform.hdnchkMaxBandwith.checked = false;
  101.             SetMaxBW(false);
  102.         }
  103.         else{
  104.             str = stripChar(thiscntrl.value,",");
  105.             num = parseInt(str);
  106.             if (!isNaN(num)){
  107.             document.userform.MaxBandwidth.value = num * 1024;
  108.             }
  109.         }
  110.     }
  111.  
  112.     function stripChar(str,chr){
  113.         while (str.indexOf(chr) != -1){
  114.             str = str.substring(0,str.indexOf(chr)) + str.substring(str.indexOf(chr)+1,str.length);
  115.         }
  116.         return str;
  117.     }
  118.  
  119.     function moveSlider(control, prop,num){
  120.         top.title.Global.updated=true;
  121.         <% if Session("IsIE") then %>
  122.             slideurl="iislider.asp?selnum="+num+"&stops=3&width=180&prop="+prop;
  123.             control.value=num;
  124.             document.Slider.location.href=slideurl;            
  125.         <% else %>
  126.             turnSlideOff(lastslide);
  127.             lastslide=prop+num;
  128.             thisprop=prop+num;
  129.             document [thisprop].src=slideron.src;
  130.             control.value=num;
  131.         <% end if %>
  132.     }
  133.  
  134.     function turnSlideOff(prop){
  135.                 document [prop].src=slideroff.src;
  136.     }
  137.     
  138. //sets CPU Throttling properties not exposed in the UI
  139. //these are all stored as 1000 of a percent.
  140. //This gets called if a change is made to CPU Max amount, or if the user checks LogOnly
  141. function setCPUThrottle()
  142. {
  143.     //shortcut our formname
  144.     uform = document.userform;
  145.     
  146.     //if LogOnly is checked, we need to set the unexposed properties to 0;
  147.     if (uform.hdnEnforceLimits.checked)
  148.     {
  149.         uform.CPULimitLogEvent.value = setToMax((uform.hdnPctCPULimitLogEvent.value * 1000),100000);
  150.         uform.CPULimitPriority.value = setToMax((uform.hdnPctCPULimitLogEvent.value * 1.50 * 1000),100000);
  151.         uform.CPULimitProcStop.value = setToMax((uform.hdnPctCPULimitLogEvent.value * 2.00 * 1000),100000);
  152.         uform.CPULimitPause.value = 0;
  153.     }
  154.     else
  155.     {
  156.         uform.CPULimitLogEvent.value = uform.hdnPctCPULimitLogEvent.value * 1000;
  157.         uform.CPULimitPriority.value = 0;
  158.         uform.CPULimitProcStop.value = 0;
  159.         uform.CPULimitPause.value = 0;    
  160.     }
  161. }
  162.  
  163. //limit a value to either the value or the maxvalue, whichever is less.
  164. function setToMax(val, maxval)
  165. {
  166.     if (val > maxval)
  167.     {
  168.         return maxval;
  169.     }
  170.     return val;
  171. }    
  172.     
  173.  
  174. </SCRIPT>
  175. </HEAD>
  176.  
  177. <BODY BGCOLOR="<%= Session("BGCOLOR") %>" TOPMARGIN=5 TEXT="#000000" LINK="#000000"  >
  178. <TABLE WIDTH = 500 BORDER = 0>
  179. <TR>
  180. <TD>
  181. <%= sFont("","","",True) %>
  182. <B><%= L_PERFORMANCE_TEXT %></B>
  183. <P>
  184. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  185. <%= L_TUNING_TEXT %>
  186. <IMG SRC="images/hr.gif" WIDTH=<%= L_TUNING_HR_W %> HEIGHT=2 BORDER=0 ALIGN="middle">    
  187.  
  188. <TABLE>
  189. <TR>
  190.     <TD><%= sFont("","","",True) %>
  191. <%= L_TUNESERVER_TEXT %><P>
  192.     <TABLE BORDER=0>
  193.         <TR>                    
  194.                 <TD COLSPAN=5><%= sFont("","","",True) %>
  195.                 <% if Session("IsIE") then %>
  196.                 <IFRAME NAME="Slider" HEIGHT=<%= L_SLIDERFRM_H %> FRAMEBORDER=0 WIDTH=<%= L_SLIDERFRM_W %> SRC="iislider.asp?stops=3&width=180&prop=ServerSize&selnum=<%= currentobj.ServerSize %>">
  197.                 </IFRAME>
  198.                 <% else %>
  199.                     <%= writeSlider("ServerSize", 3, L_SLIDERSTEPSIZE_NUM, currentobj.ServerSize) %>                     
  200.                 <% end if %>
  201.                 </TD>
  202.             </TR>
  203.  
  204.             <TR>
  205.                 <TD WIDTH= 130 ALIGN="left">                    
  206.                     <%= sFont("","","",True) %>
  207.                         <A HREF="javascript:moveSlider(document.userform.ServerSize,'ServerSize',0)">                                
  208.                         <%= L_MINHITS_TEXT %>
  209.                         </A>
  210.                     </FONT>
  211.                 </TD>                
  212.                 <TD WIDTH= 130 ALIGN="center">                                        
  213.                     <%= sFont("","","",True) %>    
  214.                         <A HREF="javascript:moveSlider(document.userform.ServerSize,'ServerSize',1)">                                    
  215.                         <%= L_MIDHITS_TEXT %>
  216.                         </A>
  217.                     </FONT>
  218.                 </TD>
  219.                 <TD WIDTH= 130 ALIGN="right">                                        
  220.                     <%= sFont("","","",True) %>                                
  221.                         <A HREF="javascript:moveSlider(document.userform.ServerSize,'ServerSize',2)">    
  222.                         <%= L_MAXHITS_TEXT %>
  223.                         </A>
  224.                     </FONT>
  225.                 </TD>
  226.             </TR>
  227.         </TABLE>
  228.         </FONT>
  229.     </TD>
  230. </TR>
  231. </TABLE>
  232.  
  233. </BLOCKQUOTE>
  234. <FORM NAME="userform">
  235. <%= sFont("","","",True) %>
  236. <INPUT TYPE="hidden" NAME="ServerSize" VALUE="<%= currentobj.ServerSize %>">
  237.  
  238. <% if Session("vtype") <> "svc" then %>
  239.     <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">    
  240.     <%= checkboxVal(0, currentobj.MaxBandwidth > 0 , "hdnchkMaxBandwith", "SetMaxBW(this.checked);", True) %>    
  241.      <%= L_ENABLEBANDWIDTH_TEXT %></B>
  242.     <IMG SRC="images/hr.gif" WIDTH=<%= L_ENABLEBANDWIDTH_HR_W %> HEIGHT=2 BORDER=0 ALIGN="middle">    
  243.  
  244.     <TABLE WIDTH = 400>
  245.     <TR>
  246.         <TD COLSPAN=2>
  247.             <%= sFont("","","",True) %>
  248.             <%
  249.             if currentobj.MaxBandwidth < 0 then
  250.                 mbw = ""
  251.             else
  252.                 mbw = currentobj.MaxBandwidth/1024
  253.             end if
  254.             %>
  255.             <%= L_LIMITNET_TEXT %><P>
  256.             <%= L_MAXNETUSAGE_TEXT %> <%= inputbox(0,"text","hdnMaxBandwidth",mbw,L_MAXNETUSAGE_NUM,"","","isNum(this,1,32767);calcBW(this);",True,True, not Session("IsAdmin") ) %> <%= L_KBS_TEXT %>
  257.             <INPUT TYPE="hidden" NAME="MaxBandwidth" VALUE="<%= currentobj.MaxBandwidth%>">
  258.             </FONT>
  259.         </TD>
  260.     </TR>
  261.     </TABLE>
  262.     </BLOCKQUOTE>
  263. <% end if %>
  264.  
  265.  
  266.     <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">    
  267.     <%= checkbox("CPULimitsEnabled", "", True) %>     
  268.     <%= L_ENABLECPUACCT_TEXT %></B>
  269.     <IMG SRC="images/hr.gif" WIDTH=<%= L_ENABLECPUACCT_HR_W %> HEIGHT=2 BORDER=0 ALIGN="middle">    
  270.     <BR>
  271.     <TABLE WIDTH = 400>
  272.     <TR>
  273.         <TD COLSPAN=2>
  274.             <%= sFont("","","",True) %>
  275.             <%= L_MAXCPUUSAGE_TEXT %> 
  276.             <%= inputbox(0,"text","hdnPctCPULimitLogEvent",(currentobj.CPULimitLogEvent/1000),L_MAXCPUUSAGE_NUM,"","","isNum(this,0,32767);setCPUThrottle();",False,True, not Session("IsAdmin") ) %>
  277.              <%= L_PRCNT_TEXT %>
  278.             <%= writehidden("CPULimitLogEvent") %>            
  279.             <%= writehidden("CPULimitPriority") %>
  280.             <%= writehidden("CPULimitProcStop") %>
  281.             <%= writehidden("CPULimitPause") %>                        
  282.             <P>
  283.             <%
  284.                 logonly = (currentobj.CPULimitLogEvent <> 0) and (currentobj.CPULimitPriority = 0 and currentobj.CPULimitProcStop = 0 and currentobj.CPULimitPause = 0)
  285.             %>
  286.             <%= checkboxVal(0, not logonly, "hdnEnforceLimits", "setCPUThrottle();", True)%> <%= L_LOGEVENT_TEXT %>     
  287.             </FONT>
  288.         </TD>
  289.     </TR>
  290.     </TABLE>
  291.  
  292. </FONT>
  293.  
  294. </FORM>
  295.  
  296. </TD>
  297. </TR>
  298. </TABLE>
  299.  
  300. <% if Session("vtype") <> "svc" then %>
  301. <SCRIPT LANGUAGE="JavaScript">
  302.     if (document.userform.MaxBandwidth.value==-1){
  303.         document.userform.MaxBandwidth.value=""
  304.     }
  305.         
  306. </SCRIPT>
  307. <% end if %>
  308.  
  309.  
  310.  
  311. </BODY>
  312.  
  313.  
  314. </HTML>
  315.  
  316. <% end if %>